import { ICarousel } from "../models";
import { RecoData } from "../pages/index/models";
import request from "../utils/request";

/**
 * @description 获取轮播图
 * @author Bronson
 * @date 2022-05-16
 * */

export const getBanners = ():Promise<ICarousel[]> => {
  return request.get({url:"/v1/cookbook/getBanners"})
}

/**
 * @description 获取分类的菜谱列表
 * @author Bronson
 * @date 2022-05-16
 * */
export const getCommonList = (type: string):Promise<RecoData[]> => {
  return request.get({ url:"/v1/cookbook/getListByName",data:{
    name:type
  }})
}

/**
 * @description 获取菜谱列表
 * @author Bronson
 * @date 2022-05-16
 * */
 export const getList = (type:string):Promise<RecoData[]> => {
  return request.get({ url:"/v1/cookbook/list"})
}


/**
 * @description 获取详情
 * @author Bronson
 * @date 2022-05-16
 * */
 export const getDetail = (cookId:string):Promise<RecoData> => {
  return request.get({ url:"/v1/cookbook/detail",data:{
    id:cookId
  }})
}
